package cn.vin.config;

import cn.vin.filter.DogFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: Wu Shenzhuang
 * @Date: 2019/5/31 11:34
 */
@Configuration
public class FilterConfig {
    @Bean
    public FilterRegistrationBean dogFilter() {
        FilterRegistrationBean<DogFilter> registration = new FilterRegistrationBean<>();
        DogFilter filter = new DogFilter();
        registration.setFilter(filter);
        registration.addUrlPatterns("/*");
        registration.setName("dog-filter");
        registration.setOrder(1);
        return registration;
    }
}
